﻿using System;
using System.Data;
using System.Collections.Generic;
using Maticsoft.Common;

namespace cebao.BLL
{
    public class dbstatus
    {
        private readonly cebao.DAL.dbstatus dal = new cebao.DAL.dbstatus();
        public int GetRecordCount(string type, string strWhere, string avg)
        {
            if (type == "YBQ")
            {
                if (avg == "")
                    return dal.YBQGetRecordCount(strWhere);
                else
                {
                    return dal.YBQGetRecordCountAVG(strWhere, avg);
                }
            }
            else
                if (type == "CBJ")
                return dal.CBJGetRecordCount(strWhere);

            else
                return 0;
        }
        public DataSet GetListByPage(string type, string strWhere, string orderby, int startIndex, int endIndex, string avg)
        {
            if (type == "YBQ")
            {
                if (avg == "")
                    return dal.YBQGetListByPage(strWhere, orderby, startIndex, endIndex);
                else
                {
                    return dal.YBQGetListByPageAVG(strWhere, orderby, startIndex, endIndex, avg);
                }
            }
            else
                if (type == "CBJ")
                return dal.CBJGetListByPage(strWhere, orderby, startIndex, endIndex);
            else
                return null;
        }
        public DataSet GetXQH(string devid, int PageSize, int PageIndex, string strWhere, out int count, string type)
        {
            return dal.GetXQH(devid, PageSize, PageIndex, strWhere, out count, type);
        }
        public DataSet GetTSQ(string devid, int PageSize, int PageIndex, string strWhere, out int count)
        {
            return dal.GetTSQ(devid, PageSize, PageIndex, strWhere, out count);
        }
        public string GetPhnum(string xqhid)
        {
            return dal.GetPhnum(xqhid);
        }
        public DataSet HZYBQ(string strWhere, string date)
        {
            return dal.HZYBQ(strWhere, date);
        }
        public DataSet HZCBJ(string strWhere, string orderby, int startIndex, int endIndex)
        {
            return dal.HZCBJ(strWhere, orderby, startIndex, endIndex);
        }
        public DataSet HZTSQ(string strWhere, string date)
        {
            return dal.HZTSQ(strWhere, date);
        }
        public void JBTSQ(string strWhere, string date, out decimal avgwd, out decimal sumyl)
        {
            dal.JBTSQ(strWhere, date, out avgwd, out sumyl);
        }
    }
}
